/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.teach.dao;

import com.lczyfz.istep.common.persistence.CrudDao;
import com.lczyfz.istep.common.persistence.annotation.MyBatisDao;
import com.lczyfz.istep.modules.teach.entity.TeachClass;
import com.lczyfz.istep.modules.teach.entity.TeachStudent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 学生管理DAO接口
 * @author cqh
 * @version 2017-01-14
 */
@MyBatisDao
public interface TeachStudentDao extends CrudDao<TeachStudent> {
    //获取所有班级名称
    List<TeachClass> findAllClassList(String DEL_FLAG_NORMAL);

    //批量添加到班级-根据班级id联动获取不在该班级内的学生
    List<TeachStudent> findBatchAddStudentByClassId(@Param("classId")String classId,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    //获取所有登录名
    List<TeachStudent> findAllLoginName(String DEL_FLAG_NORMAL);

    //根据登录名获取学生记录
    TeachStudent findStudentByLoginName(@Param("loginName")String loginName,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    //插入用户和角色关联表数据
    void studentInsertUserRole(@Param("userId")String userId, @Param("roleId")String roleId);

    //删除用户和角色关联表数据-真删除
    void studentDeleteUserRole(@Param("userId")String userId);

    //插入班级学生关联表数据
    void studentInsertClassStudent(@Param("userId")String userId, @Param("classId")String classId);

    //TODO 该方法目前未被用到
    //修改班级学生关联表数据
    void studentUpdateClassStudent(@Param("userId")String userId, @Param("classId")String classId);

    //删除班级学生关联表数据-真删除
    void studentDeleteClassStudent(@Param("userId")String userId);

    //根据班级id找到属于该班级下的所有学生
    List<TeachStudent> findStudentByClassId(@Param("classId")String classId,@Param("DEL_FLAG_NORMAL")String DEL_FLAG_NORMAL);

    //AlisaYe
    //根据班级查询该班级学生列表
    List<TeachStudent> findListByClassId(TeachStudent teachStudent);
//    List<TeachStudent> findAllStudentList(TeachStudent teachStudent);
    List<TeachStudent> findAllStudentList(String DEL_FLAG_NORMAL);

}